NPI Matching Logic
The stored procedure spGetNPIPersonDupeRecords__c in the Aptify Database is used to find duplicate records based on various matching criteria such as NPI number, name, address, and license details.
Steps
-
Initialize Variables:
- Set up temporary storage for results.
- Prepare input parameters by trimming whitespace and ensuring they are not null.
-
Matching Process:
| MatchType | Logic Description |
|---|---|
| Awesomely Perfect | Match by First Name, Last Name, NPI Number or NCSBN ID. If all fields match with a person’s record, it’s considered a perfect match. |
| Awesomely Perfect | If no match found by NP or NCSBN ID, then match by First Name, Last Name, License Number, and License State. If all four fields match, it’s considered a perfect match. |
| Very Close Match | If no perfect match is found, then match by First Name, Last Name, Address Line 1, City, and State against the best address. If all fields match, it’s a very close match. |
| Very Close Match | If no match is found in the best address, then match by First Name, Last Name, Address Line 1, City, and State against the person’s business address. |
| Close Match | If no very close match is found, then match by First Name, Last Name, City, and State against the best address. If all fields match, it’s a close match. |
| No Match | If no match is found, the record is flagged as unmatched. The record will be imported into the NP Demographics database as a new person. |
-
Output:
- The procedure outputs all the found matches along with their match types.
-
Clean Up:
- Drops the temporary storage to clean up.